﻿using UnityEngine;
using UnityEditor;

/// <summary>
/// 一些个性化的设置，组件 
/// </summary>
public class EditorTools : EditorWindow
{
    /// <summary>
    /// 普通布局 - 常用布局 
    /// </summary>
    public static Rect NormalRect = new Rect(100, 100, 800, 600);

    /// <summary>
    /// 设置Label相应的属性
    /// </summary>
    /// <param name="text">要显示的文本</param>
    /// <param name="color">字体颜色</param>
    /// <param name="fontsize">字体大小</param>
    /// <param name="alignment">对齐方式</param>
    /// <param name="options">其他选项</param>
    public static void Label(string text, Color color, int fontsize, TextAnchor alignment, params GUILayoutOption[] options)
    {
        GUIStyle style = new GUIStyle();
        style.fontSize = fontsize;
        style.normal.textColor = color;
        style.alignment = alignment;
        style.wordWrap = true;
        GUILayout.Label(text, style, options);
    }

    /// <summary>
    /// 设置默认Label属性：白色，16号字体，左对齐
    /// </summary>
    /// <param name="text">要显示的文本</param>
    /// <param name="options">其他选项</param>
    public static void Label(string text, params GUILayoutOption[] options)
    {
        Label(text, Color.white, 16, TextAnchor.MiddleLeft, options);
    }
}
